#pragma once

#include "SourceCounterBase.h"
#include <map>
#include <vector>
#include <string>
using namespace std;

#ifdef _TCHAR_DEFINED
#define string wstring
#endif
class CSourceCounterMgr
{
public:
	CSourceCounterMgr(void);
	virtual ~CSourceCounterMgr(void);

	bool AddSourceCounter(TCHAR* pszFileExts, CSourceCounterBase *pCounter);
	bool CountDirectory(TCHAR* pszDirectory, int &nBlankLines, int &nCommentLines, int &nCodeLines);
	bool CountFile(TCHAR* pszFile, int &nBlankLines, int &nCommentLines, int &nCodeLines);
protected:
	bool IsMethodExist(string& strFileExt);
	CSourceCounterBase* GetCountMethod(string& strFileExt);
private:
	struct CountMethod 
	{
		string strFileExt;
		CSourceCounterBase *pCounter;
	};

	typedef vector<CountMethod> CVecCountMethod;
	CVecCountMethod m_vecCountMethods;
};

#undef string